package com.fhz.mvvm.ui.main.datasource;

import androidx.lifecycle.LiveData;

import com.fhz.mvvm.ServiceApi;
import com.fhz.mvvm.callback.ApiResponse;
import com.fhz.mvvm.entity.Banner;
import com.fhz.mvvm.entity.GoodsInfo;
import com.fhz.mvvm.util.RetrofitMananger;

import javax.inject.Inject;

import io.reactivex.Observable;
import retrofit2.http.Query;

/**
 * 时间:2023/8/17
 *
 * @author Mr.Feng
 * 简述: 远程请求
 */
public class MainRetrofitDataSource {
    //加载Retrofit

    @Inject
    ServiceApi mServiceApi;

    @Inject
    public MainRetrofitDataSource() {
    }

    public LiveData<ApiResponse<Banner>> getBanner(@Query("type") int type, @Query("page") int page, @Query("pageSize") int pageSize){
        return mServiceApi.getBanner(type, page, pageSize);
    }


    public LiveData<ApiResponse<GoodsInfo>> getGoodsInfo(@Query("page") int page, @Query("pageSize") int pageSize){
        return mServiceApi.getGoodsInfo(page,pageSize);
    }

}
